package cn.hit.constant;

public class HitConstants {

    // 主窗口Title
    public static final String MAIN_WIN_TITLE = "脚本工具";

    // 选择文件按钮Label
    public static final String BUTTON_CHOOSE_FILE_LABEL = "选择";

    // 确定按钮Label
    public static final String BUTTON_YES_LABEL = "确定";

    // 选择资源列表Label
    public static final String INPUT_CHOOSE_SOURCE_LIST_LABEL = "选择资源列表:";

    // 执行脚本路径Label
    public static final String INPUT_EXECUTE_SOURCE_PATH_LABEL = "执行脚本路径:";

    // 根据SVN号输出文件Label
    public static final String BUTTON_CALL_SVN_WIN_LABEL = "输出SVN文件";

    // SVN资 源 路 径Label
    public static final String SVN_SCOURCE_PATH_LABEL = " 资 源 路 径：";

    // SVN输 出 路 径Label
    public static final String SVN_EXPORT_PATH_LABEL = " 输 出 路 径：";

    // SVN版本号Label
    public static final String SVN_VERSION_NO_LABEL = "SVN版本号：";

    // 导出测试数据Label
    public static final String BUTTON_GENERATE_TESTDATA_LABEL = "导出测试数据";

    // 导出脚本Label
    public static final String BUTTON_EXPORT_FILE_LABEL = "导出脚本";

    // 执行脚本Label
    public static final String BUTTON_EXECUTE_FILE_LABEL = "执行脚本";

    // 默认数据库连接
    public static final String DB_DEFAULT_URL = "jdbc:sqlserver://192.168.1.XXX:1433;databaseName=DXS100_V1;SelectMethod=Cursor;";

    // 默认数据库用户名
    public static final String DB_DEFAULT_USER_NAME = "sa";

    // 默认数据库用户密码
    public static final String DB_DEFAULT_USER_PASSWORD = "yuanli";

    // 选择文件窗口默认路径
    public static final String FILE_CHOOSER_DEFAULT_DRICTORY = "D:\\VSS";

    // 输出脚本文件目录
    public static final String EXPORT_SOURCE_DRICTORY = "source";

    // 输出日志文件目录
    public static final String EXPORT_LOG_DRICTORY = "log";

    // 超过多少行Log开始滚屏
    public static final int LOG_ROLL_LINE_SIZE = 15;

    // 执行导出线程和执行脚本线程睡眠的时间
    public static final int DEFER_SLEEP_TIME = 20;
    
    // 解析Excel线程的睡眠时间
    public static final int PARSE_EXCEL_SLEEP_TIME = 10;

    /**
     * ============================== DB Constants ==============================
     */

    // 连接数据库Label
    public static final String DB_URL_LABEL = "数 据 库 连 接:";

    // 连接数据库用户名Label
    public static final String DB_USER_NAME_LABEL = "数据库用户名:";

    // 连接数据库用户密码Label
    public static final String DB_USER_PASSWORD_LABEL = "数据库密码:";

    // 连接数据库最大超时时间
    public static final int DB_ACCESS_TIMEOUT = 3;

    // 程序信息表名
    public static final String DB_APP_INFO_TABLE_NAME = "hat_sys_app_info";
    // 程序信息ID字段名
    public static final String DB_APP_INFO_TABLE_ID_FIELD_NAME = "strAppId";
    // 程序信息NO字段名
    public static final String DB_APP_INFO_TABLE_NO_FIELD_NAME = "strAppNo";

    // 用户信息表名
    public static final String DB_USER_INFO_TABLE_NAME = "hat_sys_user_info";
    // 用户信息ID字段名
    public static final String DB_USER_INFO_TABLE_ID_FIELD_NAME = "strUserId";
    // 用户信息NO字段名
    public static final String DB_USER_INFO_TABLE_NO_FIELD_NAME = "strUserNo";

    // 码类信息表名
    public static final String DB_CODE_SORT_TABLE_NAME = "hat_sys_codesort_info";
    // 码类信息ID字段名
    public static final String DB_CODE_SORT_TABLE_ID_FIELD_NAME = "strCodeSortId";
    // 码类信息NO字段名
    public static final String DB_CODE_SORT_TABLE_NO_FIELD_NAME = "strCodeSortNo";

    // 码值信息表名
    public static final String DB_CODE_VALUE_TABLE_NAME = "hat_sys_codevalue_info";
    // 码值信息ID字段名
    public static final String DB_CODE_VALUE_TABLE_ID_FIELD_NAME = "strCodeValueId";
    // 码值信息NO字段名
    public static final String DB_CODE_VALUE_TABLE_NO_FIELD_NAME = "strCodeValueNo";

    // 共通表字段名(在Excel里面没有维护到的字段，新建时候要用)
    public static final String[] DB_COMMON_TABEL_FIELDS = { "strModifyId", "datCreateTime",
            "strCreateId", "numShowOrder" };

    // 码类信息表字段名
    public static final String[] DB_CODE_SORT_FIELDS = { "strCodeSortId", "strCodeSortNo",
            "strCodeSortCode", "strCodeSortName", "strShowName", "strCodeSortJm",
            "strCodeSortType", "strCodeSortSource", "strRightFlg", "strCodeSortStatus",
            "strValidFlg", "strAppId", "strCreateId", "datModifyTime", "strOperateFlg",
            "strComment" };

    // 码值信息表名
    public static final String[] DB_CODE_VALUE_FIELDS = { "strCodeValueId", "strCodeValueNo",
            "strCodeValueCode", "strCodeValueName", "strShowName", "strCodeValueJm",
            "strCodeValueType", "strCodeValueSource", "strRightFlg", "strCodeValueStatus",
            "strValidFlg", "datModifyTime", "strComment" };

    // 在导出测试数据时，代替strModifyId和strCreatId
    public static final String DB_TEST_DATA_REFID = "@refid";

    // 数据库得到当前时间函数
    public static final String DB_FUNCTION_GETDATE = "getdate()";

    // 根据编号查询id语句
    public static final String DB_TEST_DATA_QUERY_ID_BY_NO = "declare " + DB_TEST_DATA_REFID
            + " char(40)  select @refid = strUserId from hat_sys_user_info where strUserNo = "+ HitConstants.USER_INFO_MANAGER_NO + "\n";

    /**
     * ============================== Excel Constants ==============================
     */
    // 码类Excel中连接码值Excel的超链接(URL)的X坐标
    public static final int EXCEL_URL_X_COORDINATE = 1;

    // 码类维护状态的X坐标
    public static final int EXCEL_OPERATION_STATUS_X_COORDINATE = 14;

    // 码类或码值开始读取信息的X坐标
    public static final int EXCEL_START_READ_X_COORDINATE = 1;

    // Excel表名标记
    public static final String EXCEL_TABLE_NAME_MARK = "{TableName}";

    // Excel字段描述标记
    public static final String EXCEL_FIELDS_NAME_DESCRIPTION_MARK = "{FieldsDescriptionName}";

    // Excel字段名标记
    public static final String EXCEL_FIELDS_NAME_MARK = "{FieldsName}";

    // Excel测试数据
    public static final String EXCEL_TEST_DATA_MARK = "{TestData}";

    // Excel测试数据 newid
    public static final String EXCEL_TEST_DATA_NEWID_MARK = "'{newid}'";

    // Excel测试数据 referenceid
    public static final String EXCEL_TEST_DATA_REFID_MARK = "'{refid}'";

    // Excel测试数据 datetime
    public static final String EXCEL_TEST_DATA_DATATIME_MARK = "'{datetime}'";

    /**
     * ============================== File Type Constants ==============================
     */
    // Excel文件类型
    public static final String FILE_TYPE_XLS = ".xls";
    // Sql脚本文件
    public static final String FILE_TYPE_SQL = ".sql";
    // 文本文件
    public static final String FILE_TYPE_TXT = ".txt";
    // 日志文件
    public static final String FILE_TYPE_LOG = ".log";

    /**
     * ============================== Been Constants ==============================
     */
    // 维护人：HIT：李伟琦 
    public static final String USER_INFO_MANAGER_NO = "'HIT'";
    public static final String USER_INFO_MANAGER_NAME = "'李伟琦'";

    // 公用：00：待定 90:其他
    public static final String COMMON_DD_NO = "'01'";
    public static final String COMMON_DD_NAME = "'待定'";
    public static final String COMMON_OTHER_NO = "'90'";
    public static final String COMMON_OTHER_NAME = "'其他'";

    // 码类类别： 01:系统码类 02:业务码类
    public static final String CODE_SORT_TYPE_SYS_NO = "'01'";
    public static final String CODE_SORT_TYPE_SYS_NAME = "'系统码类'";
    public static final String CODE_SORT_TYPE_CLIENT_NO = "'02'";
    public static final String CODE_SORT_TYPE_CLIENT_NAME = "'业务码类'";

    // 码类类别： 01:默认 02:可选 03:触发
    public static final String CODE_VALUE_TYPE_DEFAULT_NO = "'01'";
    public static final String CODE_VALUE_TYPE_DEFAULT_NAME = "'默认'";
    public static final String CODE_VALUE_TYPE_OPTIONAL_NO = "'02'";
    public static final String CODE_VALUE_TYPE_OPTIONAL_NAME = "'可选'";
    public static final String CODE_VALUE_TYPE_TRIGGER_NO = "'03'";
    public static final String CODE_VALUE_TYPE_TRIGGER_NAME = "'触发'";

    // 共通来源：01：编辑维护 02：数据导入
    public static final String COMMON_SOURCE_WRITE_NO = "'01'";
    public static final String COMMON_SOURCE_WRITE_NAME = "'编辑维护'";
    public static final String COMMON_SOURCE_IMPORT_NO = "'02'";
    public static final String COMMON_SOURCE_IMPORT_NAME = "'数据导入'";

    // 权限标示：0：超级权限 1：系统配置
    public static final String COMMON_RIGHT_SUPER_NO = "'0'";
    public static final String COMMON_RIGHT_SUPER_NAME = "'超级权限'";
    public static final String COMMON_RIGHT_SYS_NO = "'1'";
    public static final String COMMON_RIGHT_SYS_NAME = "'系统配置'";

    // 共通状态：01：启用 02：停用
    public static final String COMMON_STATUS_ENABLED_NO = "'01'";
    public static final String COMMON_STATUS_ENABLED_NAME = "'启用'";
    public static final String COMMON_STATUS_DISABLED_NO = "'02'";
    public static final String COMMON_STATUS_DISABLED_NAME = "'停用'";

    // 有效标示：0：无效 1：有效
    public static final String COMMON_VALID_ENABLED_NO = "'1'";
    public static final String COMMON_VALID_ENABLED_NAME = "'有效'";
    public static final String COMMON_VALID_DISABLED_NO = "'0'";
    public static final String COMMON_VALID_DISABLED_NAME = "'无效'";

    // 操作标示：0：已经完成
    public static final String COMMON_OPERATION_STATUS_NO = "'0'";
    public static final String COMMON_OPERATION_STATUS_NAME = "'已经完成'";

    /**
     * ============================== Date Constants ==============================
     */
    //日期格式化(yyyy-MM-dd)
    public static final String DATE_FORMAT_TYPE = "yyyy-MM-dd";
    
    //日期格式化(yyyy-MM-dd HH-mm-ss-SSS)
    public static final String DATE_TIME_FORMAT_TYPE = "yyyy-MM-dd HH-mm-ss-SSS";
    
    /**
     * ============================== Export File Name Constants ==============================
     */
    // 输出码类码值文件名
    public static final String EXPORT_FILE_NAME_CODE_SCRIPT = "Excel生成的码类码值Sql脚本";

    // 输出码类码值Log文件名
    public static final String EXPORT_FILE_NAME_CODE_LOG = "Excel生成的码类码值日志";

    // 输出测试数据文件名
    public static final String EXPORT_FILE_NAME_TEST_DATA_SCRIPT = "Excel生成测试数据Sql脚本";

    // 输出测试数据Log文件名
    public static final String EXPORT_FILE_NAME_TEST_DATA_LOG = "Excel生成测试数据日志";
    
    
    /**
     * ============================== File Encoding Constants ==============================
     */
    public static final String FILE_ENCODING = "UTF-8";
}